const sign = require("./sign");
/**
 * 参数签名
 *  */
exports.getDewuQueryStr = (query) => {
    query.sign = sign(query);
    return Object.keys(query)
        .map((key) => key + "=" + encodeURIComponent(query[key]))
        .join("&");
}

exports.dewuHeaders = () => {
    return {
        accept: '*/*',
        appid: 'wxapp',
        appversion: '4.64.1.2',
        platform: 'h5',
        'context-type': 'application/x-www-form-urlencoded',
        // 'referer': 'https://servicewechat.com/wx3c12cdd0ae8b1a7b/117/page-frame.html',
        // 'wxapp-login-token': '3f885cf3|5805b23362561089694d1976c3f2ea84|1843f86c|13d7302d',
        'accept-language': 'zh-cn',
        'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.12(0x17000c2f) NetType/WIFI Language/zh_CN'
    }
}